﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<List<VietPublisher.BaseProject.Models.ListBook>>" %>
<div id="slidesBookNew">
    <div class="slides_container">
        
        <% 
            int i = 0;
            int y = 0;
            int count=0;
            if (Model != null)
            {
                count = Model.Count();

                //bool closediv = false; 
                foreach (var books in Model)
                { 
                               
        %>
            <% //mo div cha chua 4 item con tren 1 lan slide]
                    i++;
                    y++;
                    if (y == 1)
                    {
                        // closediv = true;  
            %>
              <div class="slide">
            <%} %>  

            <%--hien thi item--%>
            <div class="item">
                    <%--book--%>
                    <div class="SlideImage">
                        <%--<%=books.PictureID %>--%>
                         <a href="/Book/<%=books.BookID %>" style="width:auto; height:auto;">
                        <img style="max-width:272px; max-height:320px;" alt="ddd" src="/Handlers/ImageHandler.ashx?groupid=<%=books.PictureID %> " />
                        </a>
                    </div>
                    <div class="SlideNameBook">
                        <%
                    string str = books.BookTitle;
                    if (str.Length > 35)
                    {
                        str = str.Substring(0, 35) + "...";
                    }
                         %>
                        <a href="/Book/<%=books.BookID %>" title="<%=books.BookTitle %>" style="width:auto; height:auto;"><%=str%></a>
                    </div>
       
            </div>

            <% if (y == 6 || i == count)
               {
                   y = 0;
                   // closediv = false;
            %>
               </div>
            <%} %>
            
        <%                }
            }%>
    </div>
    <a href="#" class="prev">
        <img src="../../Content/image/icon/arrow-prev.png" width="24" height="43" alt="Arrow Prev" /></a>
    <a href="#" class="next">
        <img src="../../Content/image/icon/arrow-next.png" width="24" height="43" alt="Arrow Next" /></a>
</div>
